home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Check if a file exists?
- Date: Sun, 14 Apr 96 23:32:08 GMT
- Organization: none
- Message-ID: <829524728snz@genesis.demon.co.uk>
- References: <4kp7pg$upe@news-s01.ny.us.ibm.net> <829481378snz@genesis.demon.co.uk> <4kr8n9INN4he@keats.ugrad.cs.ubc.ca>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4kr8n9INN4he@keats.ugrad.cs.ubc.ca>
- c2a192@ugrad.cs.ubc.ca "Kazimir Kylheku" writes:
-
- >In article <829481378snz@genesis.demon.co.uk>,
- >Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
- >>In article <4kp7pg$upe@news-s01.ny.us.ibm.net>
- >> bfilone@ibm.net "bfilone@ibm.net " writes:
- >>
- >>>Is it possible in C to check if a file exists other than checking for a
- >>> succesful fopen?
- >>
- >>There is no other way in standard C. The only standard C library functions
- >>that actually take a filename are fopen, freopen, rename and remove.
- >
- >But even so, Lawrence, how can you be sure that a successful fopen() means that
- >the file really *exists*? Do computers exist?
-
- Without doubt. There's just no way my imagination could have created the
- IBM PC.
-
- >It seems that one has to approach fopen() with a certain metaphysical
- >predisposition that a file really *can* exist.
-
- You're right of course. fopen() just tests whether a file is readable,
- writable or both.
-
- >The proper discussion of file existence is to be found somewhere in alt.kooks
- >and not comp.lang.c. As far as the standard is concerned, all that fopen()
- >means is that certain things are logically possible that wouldn't be if fopen()
- >failed. Assuming fopen() exists, of course. But that is off topic.
-
- It is defined in the sacred texts, therefore it exists (at least in the
- hosted parallel universe).
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-